﻿<UserControl x:Class="IS_Ever_Green.View.ProfileView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:IS_Ever_Green.View"
             mc:Ignorable="d" 
             d:DesignHeight="650"
             d:DesignWidth="900"
             >

<Border Grid.Row="2" 
        CornerRadius="16" 
        Margin="0 30 0 0"
        Background="{StaticResource panelContentColor}"
        >
        
    <Grid Margin="50">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <StackPanel Orientation="Vertical" 
                    Margin="0 50"
                    >
            <StackPanel Orientation="Horizontal">
                
                <TextBlock Text="Логин:" 
                           Foreground="{StaticResource primaryTextColor}"
                           FontSize="20"
                           FontWeight="Medium"
                           FontFamily="Montserrat"
                           Width="170"
                           HorizontalAlignment="Left"
                           Margin="0 20 0 0"
                           />

                <TextBox Text="{Binding CurrentUser.LoginUser}"
                         Foreground="{StaticResource primaryTextColor}"
                         FontSize="25"
                         FontWeight="Medium"
                         FontFamily="Montserrat"
                         CaretBrush="{StaticResource markerColor}"
                         BorderBrush="{StaticResource primaryTextColor}"
                         BorderThickness="0 0 0 1"
                         Height="35"
                         Width="300"
                         HorizontalAlignment="Left"
                         Margin="0 5 0 0"
                         Padding="30 0 0 0"
                         >

                    <TextBox.Background>
                        <ImageBrush ImageSource="/Images/User/Login.png"
                            Stretch="none"
                            AlignmentX="Left"
                            />
                    </TextBox.Background>
                </TextBox>
                
            </StackPanel>

            <StackPanel Orientation="Horizontal">

                <TextBlock Text="Имя:" 
                           Foreground="{StaticResource primaryTextColor}"
                           FontSize="20"
                           FontWeight="Medium"
                           FontFamily="Montserrat"
                           Width="170"
                           HorizontalAlignment="Left"
                           Margin="0 20 0 0"
                           />

                <TextBox Text="{Binding CurrentUser.FirstName}"
                         Foreground="{StaticResource primaryTextColor}"
                         FontSize="25"
                         FontWeight="Medium"
                         FontFamily="Montserrat"
                         CaretBrush="{StaticResource markerColor}"
                         BorderBrush="{StaticResource primaryTextColor}"
                         BorderThickness="0 0 0 1"
                         Height="35"
                         Width="300"
                         HorizontalAlignment="Left"
                         Margin="0 5 0 0"
                         Padding="30 0 0 0"
                         >

                    <TextBox.Background>
                        <ImageBrush ImageSource="/Images/User/UserName_Surname.png"
                            Stretch="none"
                            AlignmentX="Left"
                            />
                    </TextBox.Background>
                </TextBox>
                
            </StackPanel>

            <StackPanel Orientation="Horizontal">
                
                <TextBlock Text="Фамилия:"
                       Foreground="{StaticResource primaryTextColor}"
                       FontSize="20"
                       FontWeight="Medium"
                       FontFamily="Montserrat"
                       Width="170"
                       HorizontalAlignment="Left"
                       Margin="0 20 0 0"
                       />

                <TextBox Text="{Binding CurrentUser.LastName}"
                     Foreground="{StaticResource primaryTextColor}"
                     FontSize="25"
                     FontWeight="Medium"
                     FontFamily="Montserrat"
                     CaretBrush="{StaticResource markerColor}"
                     BorderBrush="{StaticResource primaryTextColor}"
                     BorderThickness="0 0 0 1"
                     Height="35"
                     Width="300"
                     HorizontalAlignment="Left"
                     Margin="0 5 0 0"
                     Padding="30 0 0 0"
                     >

                <TextBox.Background>
                    <ImageBrush ImageSource="/Images/User/UserName_Surname.png"
                        Stretch="none"
                        AlignmentX="Left"
                        />
                </TextBox.Background>
            </TextBox>
            
            </StackPanel>

            <StackPanel Orientation="Horizontal">
                
                <TextBlock Text="Почта:"
               Foreground="{StaticResource primaryTextColor}"
               FontSize="20"
               FontWeight="Medium"
               FontFamily="Montserrat"
               Width="170"
               HorizontalAlignment="Left"
               Margin="0 20 0 0"
               />

                <TextBox Text="{Binding CurrentUser.Email}"
                     Foreground="{StaticResource primaryTextColor}"
                     FontSize="25"
                     FontWeight="Medium"
                     FontFamily="Montserrat"
                     CaretBrush="{StaticResource markerColor}"
                     BorderBrush="{StaticResource primaryTextColor}"
                     BorderThickness="0 0 0 1"
                     Height="35"
                     Width="300"
                     HorizontalAlignment="Left"
                     Margin="0 5 0 0"
                     Padding="30 0 0 0"
                     >

                <TextBox.Background>
                    <ImageBrush ImageSource="/Images/User/Email.png"
                                    Stretch="none"
                                    AlignmentX="Left"
                                    />
                </TextBox.Background>
            </TextBox>
    
            </StackPanel>

            <StackPanel Orientation="Horizontal">
                
                <TextBlock Text="Номер телефона:"
                       Foreground="{StaticResource primaryTextColor}"
                       FontSize="20"
                       FontWeight="Medium"
                       FontFamily="Montserrat"
                       Width="170"
                       HorizontalAlignment="Left"
                       Margin="0 20 0 0"
                       />

                <TextBox Text="{Binding CurrentUser.NumberPhone}"
                     Foreground="{StaticResource primaryTextColor}"
                     FontSize="25"
                     FontWeight="Medium"
                     FontFamily="Montserrat"
                     CaretBrush="{StaticResource markerColor}"
                     BorderBrush="{StaticResource primaryTextColor}"
                     BorderThickness="0 0 0 1"
                     Height="35"
                     Width="300"
                     HorizontalAlignment="Left"
                     Margin="0 5 0 0"
                     Padding="30 0 0 0"
                     >

                <TextBox.Background>
                    <ImageBrush ImageSource="/Images/User/NumberPhone.png"
                                Stretch="none"
                                AlignmentX="Left"
                                />
                </TextBox.Background>
            </TextBox>
            
            </StackPanel>

            <StackPanel Orientation="Horizontal">
                
                <TextBlock Text="Пароль:"
                           Foreground="{StaticResource primaryTextColor}"
                           FontSize="20"
                           FontWeight="Medium"
                           FontFamily="Montserrat"
                           Width="170"
                           HorizontalAlignment="Left"
                           Margin="0 20 0 0"
                           />

                <TextBox Text="{Binding CurrentUser.Password}"
                         Foreground="{StaticResource primaryTextColor}"
                         FontSize="25"
                         FontWeight="Medium"
                         FontFamily="Montserrat"
                         CaretBrush="{StaticResource markerColor}"
                         BorderBrush="{StaticResource primaryTextColor}"
                         BorderThickness="0 0 0 1"
                         Height="35"
                         Width="300"
                         HorizontalAlignment="Left"
                         Margin="0 5 0 0"
                         Padding="30 0 0 0"
                         >

                    <TextBox.Background>
                        <ImageBrush ImageSource="/Images/User/Password.png"
                                    Stretch="none"
                                    AlignmentX="Left"
                                    />
                    </TextBox.Background>
                </TextBox>

            </StackPanel>
            
            <StackPanel Orientation="Horizontal">
                
                <TextBlock Text="Адрес доставки:"
                           Foreground="{StaticResource primaryTextColor}"
                           FontSize="20"
                           FontWeight="Medium"
                           FontFamily="Montserrat"
                           Width="170"
                           HorizontalAlignment="Left"
                           Margin="0 20 0 0"
                           />

                <TextBox Text="{Binding CurrentUser.DeliveryAddress}"
                         Foreground="{StaticResource primaryTextColor}"
                         FontSize="25"
                         FontWeight="Medium"
                         FontFamily="Montserrat"
                         CaretBrush="{StaticResource markerColor}"
                         BorderBrush="{StaticResource primaryTextColor}"
                         BorderThickness="0 0 0 1"
                         Height="35"
                         Width="300"
                         HorizontalAlignment="Left"
                         Margin="0 5 0 0"
                         Padding="30 0 0 0"
                         >

                    <TextBox.Background>
                        <ImageBrush ImageSource="/Images/User/Address.png"
                                    Stretch="none"
                                    AlignmentX="Left"
                                    />
                    </TextBox.Background>
                </TextBox>
                
            </StackPanel>
            
        </StackPanel>

        <Button Command="{Binding AddPhotoUserViewCommand}" 
                CommandParameter="{Binding CurrentUser}" 
                Background="Transparent"
                Width="220"
                Height="220"
                Grid.Column="2"
                VerticalAlignment="Top"
                Margin="0 50 0 0"
                BorderThickness="0"
                >
            
            <Border CornerRadius="100"
                    Width="200"
                    Height="200"
                    >

                <Image>
                    <Image.Style>
                        <Style TargetType="Image">
                            <Setter Property="Source" Value="{Binding CurrentUser.PhotoUser}" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding CurrentUser.PhotoUser}" Value="{x:Null}">
                                    <Setter Property="Source" Value="/Images/Default_profile_image.png" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Image.Style>
                </Image>

            </Border>

            <Button.Style>
                <Style TargetType="Button">
                    <Setter Property="Background" Value="Transparent"/>
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="Transparent"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Button.Style>

            <Button.Template>
                <ControlTemplate TargetType="Button">
                    <Border CornerRadius="15"
                  Background="{TemplateBinding Background}">

                        <ContentPresenter VerticalAlignment="Center"
                                HorizontalAlignment="Center"/>

                    </Border>
                </ControlTemplate>
            </Button.Template>

        </Button>
    
        <Button Command="{Binding SaveUserProfileViewCommand}"
                BorderThickness="0"
                Content="Сохранить"
                Foreground="{StaticResource secondaryTextColor}"
                FontSize="16"
                FontFamily="Montserrat"
                Cursor="Hand"
                Grid.Column="1"
                Width="300"
                Height="100"
                Margin="0 50 0 100"
                VerticalAlignment="Bottom"
                HorizontalAlignment="Center"
                >

            <Button.Style>
                <Style TargetType="Button">
                    <Setter Property="Background" Value="{StaticResource primaryButtonColor}"/>
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{StaticResource primaryButtonHoverColor}"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Button.Style>

            <Button.Template>
                <ControlTemplate TargetType="Button">
                    <Border Width="300" Height="60"
                    CornerRadius="15"
                    Background="{TemplateBinding Background}">

                        <ContentPresenter VerticalAlignment="Center"
                                    HorizontalAlignment="Center"/>

                    </Border>
                </ControlTemplate>
            </Button.Template>

        </Button>

        <TextBlock  Text="{Binding Message}"
                    Foreground="{StaticResource primaryTextColor}"
                    FontSize="20"
                    FontWeight="Medium"
                    FontFamily="Montserrat"
                    Height="30"
                    Width="200"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Bottom"
                    Margin="0 0 0 80"
                    TextWrapping="Wrap" 
                    Grid.Column="1"
                    Cursor=""
                    />  

    </Grid>

</Border>
</UserControl>
